package com.xyh.product.controller;

import com.xyh.pojo.Product;
import com.xyh.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @author 丁德成
 * @explain
 * @date 2023/5/12
 */
@RestController
@RequestMapping("/product")
public class ProductController {
    @Autowired
    private ProductService productService;

    @GetMapping("/getById/{pid}")
    public Product getById(@PathVariable Integer pid){
        Product byId = productService.findById(pid);
        return byId;
    }
}
